<script setup lang="ts">
import { computed } from "vue";
import { useStore } from "vuex";

const store = useStore();
const count = computed(() => {
  return store.state.count;
});
const increment = () => {
  const a = Math.ceil(Math.random() * 10);
  console.log(a);
  store.commit("increment", a);
};
</script>
<template>
  <div>
    <button type="button" @click="increment">{{ count }}</button>
  </div>
</template>
